this._currentWindow = -1;
this.thumbnailsVisible = false;
+
+ let apps = Shell.AppSystem.get_default().get_running ();
+
+ if (apps.length == 0)
+ return;
+
+ this._switcherList = new AppSwitcher(apps, this);
+ this._items = this._switcherList.icons;
},
_allocate: function (actor, box, flags) {
}
},
- _createSwitcher: function() {
- let apps = Shell.AppSystem.get_default().get_running ();
-
- if (apps.length == 0)
- return false;
-
- this._switcherList = new AppSwitcher(apps, this);
- this._items = this._switcherList.icons;
- if (this._items.length == 0)
- return false;
-
- return true;
- },
-
_initialSelection: function(backward, binding) {
if (binding == 'switch-group') {
if (backward) {
Name: 'WindowSwitcherPopup',
Extends: SwitcherPopup.SwitcherPopup,
- _init: function(items) {
- this.parent(items);
+ _init: function() {
+ this.parent();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' });
- },
- _getWindowList: function() {
- let workspace = this._settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace() : null;
- return global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
- },
-
- _createSwitcher: function() {
let windows = this._getWindowList();
if (windows.length == 0)
- return false;
+ return;
let mode = this._settings.get_enum('app-icon-mode');
this._switcherList = new WindowList(windows, mode);
this._items = this._switcherList.icons;
+ },
- if (this._items.length == 0)
- return false;
-
- return true;
+ _getWindowList: function() {
+ let workspace = this._settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace() : null;
+ return global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
},
_initialSelection: function(backward, binding) {
this._switcherList.actor.allocate(childBox, flags);
},
- _createSwitcher: function() {
- throw new Error('Not implemented');
- },
-
_initialSelection: function(backward, binding) {
throw new Error('Not implemented');
},
show: function(backward, binding, mask) {
- if (!this._createSwitcher())
+ if (this._items.length == 0)
return false;
if (!Main.pushModal(this.actor)) {